<template>
	<div class="app-container" @click="suspend">
		<el-table ref="table" :data="tableData" style="width: 100%;font-size: smaller;" height="280px">
			<el-table-column type="index" label="序号" />
			<el-table-column prop="checkId" width="80" label="请验单编号">
			</el-table-column>
			<el-table-column prop="checkTypeName" width="60" label="种类名">
			</el-table-column>
			<el-table-column prop="productGmp" width="80" label="gmp编码">
			</el-table-column>
			<el-table-column prop="productName" label="品名">
			</el-table-column>
			<el-table-column prop="batchNum" label="批号">
			</el-table-column>
			<el-table-column prop="registCheckDepartmentName" width="80" label="请验部门">
			</el-table-column>
			<el-table-column prop="registCheckUserName" width="60" label="请验人">
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
	
	import {
		todayCheck
	} from '@/api/dataview'
	
	export default {
		data() {
			return {
				tableData: [],
				timer:{}
			}
		},
		mounted() {
			todayCheck().then(res => {
				this.tableData = res.lists
			});
			const table = this.$refs.table
			const divData = table.bodyWrapper
			this.timer = setInterval(() => {
			  divData.scrollTop += 1
			  if (divData.clientHeight + divData.scrollTop == divData.scrollHeight) {
			    divData.scrollTop = 0
			  }
			}, 100)
		},
		methods:{
			suspend(){
				clearInterval(this.timer)
			}
		}
	}
</script>

<style>
	.el-table .cell {
		white-space: nowrap;
	}
</style>
